﻿//--------------------------------------------------------------------
// 动态报表控件模板 v1.00
//
// 开发人： 朱明智
// 创建时间： 2019-08-22
//
// 修改人：
// 修改时间：
//--------------------------------------------------------------------
namespace Dynamic
{
    public static class TemplateHelper
    {
        #region 空报表模板

        /// <summary>
        /// 空报表模板
        /// </summary>
        public const string ReportTemp =
            "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
            "<Report xmlns:rd=\"http://schemas.microsoft.com/SQLServer/reporting/reportdesigner\" xmlns=\"http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition\">" +
            "   <DataSources>" +
            "       <DataSource Name=\"DummyDataSource\">" +
            "           <ConnectionProperties>" +
            "               <DataProvider>SQL</DataProvider>" +
            "               <ConnectString />" +
            "           </ConnectionProperties>" +
            "           <rd:DataSourceID>3eecdab9-6b4b-4836-ad62-95e4aee65ea8</rd:DataSourceID>" +
            "       </DataSource>" +
            "   </DataSources>" +
            "   <DataSets>@DataSets</DataSets>" +
            "   <Body>" +
            "       <ReportItems>" +
            "           @Tablix" +
            "       </ReportItems>" +
            "       <Style />" +
            "       <Height>1cm</Height>" +
            "   </Body>" +
            "   <Width>@Widthcm</Width>" +
            "   <Page>" +
            "       @PageHeader" +
            "       @PageFooter" +
            "       <PageHeight>@PageHeightcm</PageHeight>" +
            "       <PageWidth>@PageWidthcm</PageWidth>" +
            "       <LeftMargin>@LeftMargincm</LeftMargin>" +
            "       <RightMargin>@RightMargincm</RightMargin>" +
            "       <TopMargin>@TopMargincm</TopMargin>" +
            "       <BottomMargin>@BottomMargincm</BottomMargin>" +
            "       <ColumnSpacing>0.13cm</ColumnSpacing>" +
            "       <Style />" +
            "   </Page>" +
            "   <rd:ReportID>809f16cf-ea78-4469-bf43-965c4afe69d0</rd:ReportID>" +
            "   <rd:ReportUnitType>Cm</rd:ReportUnitType>" +
            "</Report>";

        #endregion

        #region 页眉/页脚模板

        public const string PageHeaderTemp =
@"<PageHeader>
    @Height
    <PrintOnFirstPage>true</PrintOnFirstPage>
    <PrintOnLastPage>true</PrintOnLastPage>
        <ReportItems>@Caption@Rectangle</ReportItems>
    <Style>
    <Border>
        <Style>None</Style>
    </Border>
    </Style>
</PageHeader>";

        public const string PageFooterTemp =
@"<PageFooter>
    @Height
    <PrintOnFirstPage>true</PrintOnFirstPage>
    <PrintOnLastPage>true</PrintOnLastPage>
    <ReportItems>@Rectangle</ReportItems>
    <Style>
    <Border>
        <Style>None</Style>
    </Border>
    </Style>
</PageFooter>";

        #endregion

        #region 矩形模板

        public const string RectangleTemp =
@"<Rectangle Name='Rectangle@Name'>
        <ReportItems>@Textbox</ReportItems>
        @Top
        @Left
        @Height
        @Width
        <ZIndex>1</ZIndex>
        <Style>
            <Border>
            <Style>None</Style>
            </Border>
        </Style>
</Rectangle>";

        #endregion

        #region Textbox模板

        public const string TextboxTemp = 
                                    @"<Textbox Name='Textbox@Name'>
                                        <CanGrow>true</CanGrow>
                                        <KeepTogether>true</KeepTogether>
                                        <Paragraphs>
                                        <Paragraph>
                                            <TextRuns>
                                            <TextRun>
                                                <Value>@Value</Value>
                                                <Style>@FontFamily@FontSize@FontWeight@Color@FontStyle@TextDecoration
                                                </Style>
                                            </TextRun>
                                            </TextRuns>
                                            <Style>
                                            <TextAlign>@TextAlign</TextAlign>
                                            </Style>
                                        </Paragraph>
                                        </Paragraphs>
                                        <rd:DefaultName>Textbox@Name</rd:DefaultName>
                                        @Top
                                        @Left
                                        @Height
                                        @Width
                                        <Style>
                                        <Border>
                                            <Style>None</Style>
                                        </Border>
                                        <VerticalAlign>@VerticalAlign</VerticalAlign>
                                        <PaddingLeft>2pt</PaddingLeft>
                                        <PaddingRight>2pt</PaddingRight>
                                        <PaddingTop>2pt</PaddingTop>
                                        <PaddingBottom>2pt</PaddingBottom>
                                        </Style>
                                    </Textbox>";

        #endregion

        #region DataSet

        public const string DataSetTemp =
                       "    <DataSet Name=\"@DataSetNameData\">" +
                       "       <Fields>@Fields</Fields>" +
                       "       <Query>" +
                       "           <DataSourceName>DummyDataSource</DataSourceName>" +
                       "           <CommandText />" +
                       "       </Query>" +
                       "    </DataSet>";

        #endregion

        #region Tablix

        public const string TablixTemp =
                       " <Tablix Name=\"Tablix@DataSetName\">" +
                       "   <TablixBody>" +
                       "       <TablixColumns>@TablixColumns</TablixColumns>" +
                       "       <TablixRows>" +
                       "           <TablixRow>" +
                       "               <Height>0.23622in</Height>" +
                       "               <TablixCells>@TablixHeader</TablixCells>" +
                       "           </TablixRow>" +
                       "           <TablixRow>" +
                       "               <Height>0.23622in</Height>" +
                       "               <TablixCells>@TablixCells</TablixCells>" +
                       "           </TablixRow>" +
                       "       </TablixRows>" +
                       "   </TablixBody>" +
                       "   <TablixColumnHierarchy>" +
                       "       <TablixMembers>@TablixMember</TablixMembers>" +
                       "   </TablixColumnHierarchy>" +
                       "   <TablixRowHierarchy>" +
                       "       <TablixMembers>" +
                       "           <TablixMember>" +
                       "               <KeepWithGroup>After</KeepWithGroup>" +
                       "           </TablixMember>" +
                       "           <TablixMember>" +
                       "               <Group Name=\"详细信息@DataSetName\" />" +
                       "           </TablixMember>" +
                       "       </TablixMembers>" +
                       "   </TablixRowHierarchy>" +
                       "   <DataSetName>@DataSetNameData</DataSetName>" +
                       "   <Top>@TopPositioncm</Top>" +
                       "   <Left>@LeftPostioncm</Left>" +
                       "   <Style>" +
                       "       <Border>" +
                       "           <Style>None</Style>" +
                       "       </Border>" +
                       "   </Style>" +
                       "</Tablix>";

        #endregion
    }
}